import QtQuick
import QtQuick.Controls

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    Column {
        anchors.fill: parent

        TabBar {
            id: tabBar
            currentIndex: swipeView.currentIndex
            TabButton { text: "Page1"; onClicked: swipeView.currentIndex = 0}
            TabButton { text: "Page2"; onClicked: swipeView.currentIndex = 1}
            TabButton { text: "Page3"; onClicked: swipeView.currentIndex = 2}
        }

        SwipeView {
            id: swipeView
            width: parent.width
            height: parent.height - tabBar.height

            Page {
                Label {
                    anchors.centerIn: parent
                    text: "This is Page1"
                }
            }

            Page {
                Switch {
                    anchors.centerIn: parent
                    text: "This is Page2"
                }
            }

            Page {
                Label {
                    anchors.centerIn: parent
                    text: "This is Page3"
                }
            }
        }
    }
}
